package com.zxw.java基础.字符串;

/**
 * @projectName: util-cloud
 * @package: com.zxw.java基础.字符串
 * @className: IndexOf
 * @author: zhangxuewei
 * @description:
 * @date: 2024/9/5 9:18
 * @version: 1.0
 */
public class IndexOf {

    public static void main(String[] args) {
        String snC = "LY01-C1";
        int index = snC.lastIndexOf("-C");
        System.out.println(snC.substring(index + 2));
        System.out.println(snC.substring(0, index + 2));
        Integer no = Integer.valueOf(snC.substring(index + 2)) + 1;
        String newNo = snC.substring(0, index + 2) + no;
        System.out.println(newNo);
    }
}
